/* 
 * File:   MString.c
 * Author: Muhammad Anis
 */

#include <stdio.h>
#include <stdlib.h>
#include "CSString.h"

int main(int argc, char** argv) {

    char test[] = "halo";
    printf("String lengthasd : %d\n", GetCSStringLength(test));       
    char a[] = "A,B,F,D,C";    
    char regex[] = ",";
    CSString temp;
    temp = (char*)malloc((4)*sizeof(char));  
    CopyString(a,temp,0,2);    
    printf("Hasil copy: %s\n",temp);
    char d[] = "  saya  ";
    printf("Hasil Trim: a%sa\n",Trim(d));
    CSString hasil[100];
    Split(a,hasil,regex);
    int i;
    for(i=0;i<100;i++){
        if(!EqCSString(hasil[i],"\0")){
            printf("isi : %s\n",hasil[i]);
        }
    }
    //for(i=0;i<2;i++){
    if(hasil){
        printf("hasilasdasdasd");
    }else{
        printf("!hasil");
    }    
    char X1[] = "SATU-";
    char X2[] = "DUA";
    printf("\n Test Append :%s\n",AppendString(X1,X2));
    return (EXIT_SUCCESS);
}

